import React, { Component } from 'react'
import PropTypes from 'prop-types'
import './index.css'

export default class Item extends Component {
	state = {x:123}
	static propTypes = {
		id:PropTypes.string.isRequired,
		title:PropTypes.string.isRequired,
		done:PropTypes.bool.isRequired
	}
	render() {
		return (
			<li>
				<label>
					<input type="checkbox" checked={this.props.done} onChange={this.handleCheck}/>
					<span>{this.props.title}</span>
				</label>
				<button className="btn btn-danger">删除</button>
			</li>
		)
	}
	handleCheck = ()=>{
		console.log('handleCheck执行了')
	}
}
